﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Dominio.Logica;
using Dominio.Excepciones;

namespace Interfaz
{
    public partial class Ganancias : Form
    {
        public Ganancias()
        {
            InitializeComponent();
        }

        private void Ganancias_Load(object sender, EventArgs e)
        {
            dateTimePicker1.Value = System.DateTime.Now;

        }

        private void btnAceptar_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void btnCalcular_Click(object sender, EventArgs e)
        {
            try
            {
                float total = Agencia.GetAgencia().GananciasAgencia(dateTimePicker1.Value.Date, dateTimePicker2.Value.Date);
                textBox1.Text = total.ToString();
            }
            catch (NoApuestasException ex)
            {
                MessageBox.Show(ex.mensaje, "Atención", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            
        }
    }
}
